package com.ykq.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.ykq.entity.Role;
import com.ykq.mapper.RoleMapper;
import com.ykq.service.RoleService;
import com.ykq.vo.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author: 闫克起
 * @Description:
 * @Date: Create in 9:15 2024/10/23
 */
@Service
public class RoleServiceImpl implements RoleService {
    @Autowired
    private RoleMapper roleMapper;
    @Override
    public R selectAll() {
        List<Role> list=roleMapper.selectAll();
        return R.ok(list);
    }

    @Override
    public R selectByPage(Integer current, Integer pageSize) {
        PageHelper.startPage(current, pageSize);
        List<Role> list=roleMapper.selectAll();
        PageInfo<Role> pageInfo=new PageInfo<>(list);
        return R.ok(pageInfo);
    }
}
